<script text="text/javascript">

//if 判断
var num =7
if(num%2==0){
    console.log("oushu")
}else{
    console.log("jishu")
}

//switch 流程
var score = 88;
function check(v){
    switch (true) {
        case v>80:
            return "优秀"
            break;
    
        default:
            return "普通"
            break;
    }
}
console.log(check(score))



//三目运算符
function check_num(x) {
    x % 2 == 0 ? tmp= "oushu" : tmp= "jishu" // conditon ? if true : if false
    return tmp
}
console.log(check_num(11))


//while 循环
var flag = 0
while (flag < 10 ) {
    if (flag %2  ==0) {
        console.log("i am while cycle",flag)
        
    }
    flag++
}


//dowhile 
var tmp = 10
do {
    console.log(tmp)
    tmp++
} while (tmp>20);


//for 
var array = [1,2,22,44,55]
for (let index = 0; index < array.length; index++) {
    var element = array[index];
    console.log(element)
}

//娱乐
for (var index = 0; index <= 10 ; index++) {
    for (var  j = 0 ; j <=index;j++){
        document.write("😂");
    }
    document.write("<br/>")
}
</script>



